<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// function Cat(name,age){
			// 	this.name=name;
			// 	this.age=age;
			// 	if(this.name==undefined){
			// 		this.name="张三";
			// 	}
			// 	if(this.age==undefined){
			// 		this.age=19;
			// 	}
			// }
			// var cat1=new Cat("123","12");
			// console.log(cat1.age);
			function Person(name, age, sex) {
				this.name = name;
				this.age = age;
				this.sex = sex;

			}
			Person.prototype.pr = function() {
				console.log("姓名:" + this.name + "  年龄:" + this.age + "  性别:" + this.sex);
			}
			var p1 = new Person("张三", 12, 男);
			var p2 = new Person("李四", 13, 男);
			var p3 = new Person("王五", 14, 男);
			p1.pr();
			p2.pr();
			p3.pr();
		</script>
		
	</body>
</html>
